<template>
    <div class="courses-nav">
        <el-menu :default-active="activeIndex" class="el-menu-demo"  mode="horizontal" :router="true">
            <el-menu-item index="/Teaching/MyCourses/Statistics/Teach/TeachStatistics">教学统计</el-menu-item>
            <el-menu-item index="/Teaching/MyCourses/Statistics/Teach/StudentFilesList">学生档案</el-menu-item>
            <el-menu-item index="/Teaching/MyCourses/Statistics/Teach/CourseReach">课程达成度</el-menu-item>
            <!-- <el-menu-item index="/Teaching/MyCourses/Statistics/Teach/AttenceStatistics">考勤统计</el-menu-item>
            <el-menu-item index="/Teaching/MyCourses/Statistics/Teach/ScoreStatistics">成绩统计</el-menu-item>
            <el-menu-item index="/Teaching/MyCourses/Statistics/Teach/AskStatistics">提问统计</el-menu-item> -->
        </el-menu>
    </div>
</template>

<script>
    export default {
        data () {
            return {
                activeIndex: ''
            }
        },
        created(){
          this.fetchDate()
        },
        methods: {
            fetchDate() {
                let self = this
                var cur_path = self.$route.meta.navActive; //获取当前路由
                self.activeIndex = cur_path
            }
        },
        watch:{
            $route(){
                this.fetchDate()
            }
        }
    }
</script>
<style lang="scss" scoped>
    .courses-nav{
        .el-menu-demo{
            .el-menu-item{
                i{
                    vertical-align: sub;
                    margin-right: 10px;
                }
                &:hover{
                     color:#1277eb
                }
            }
        }
    }
</style>
